﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WBType.aspx.cs" Inherits="Web.Admin.WebSiteSetting.WBType" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <link href="../../Styles/Common.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/Zebra/zebra_dialog.js" type="text/javascript"></script>
    <link href="../../Scripts/Zebra/zebra_dialog.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function change_colorOver(e) {
            var oldColor = e.style.backgroundColor;
            document.getElementById("colorName").value = oldColor;
            e.style.backgroundColor = "#b9bace";
        }
        function change_colorOut(e) {
            e.style.backgroundColor = document.getElementById("colorName").value;
        }

        function ShowFrm(wbid) {
          
            $("#WBID").val(wbid);
            $.ajax({
                url: 'ws.ashx?type=getWBTypeByID&ID=' + wbid,
                type: 'post',
                data: '',
                dataType: 'json',
                success: function (r) {
                    $('input[name=strType]').val(r[0].strType);
                    $('input[name=strDescript]').val(r[0].strDescript);

                }, error: function (r) {
                    $.Zebra_Dialog('<strong>加载数据失败 ！</strong>');
                }
            });

            $('#divEidt').fadeIn("normal");
        }

        function CloseEidt() {
            $('#divEidt').fadeOut("normal");
        }

        function WBUpdate() {
            var wbid = $("#WBID").val();
            $.ajax({
                url: 'ws.ashx?type=UpdateWBType&ID=' + wbid,
                type: 'post',
                data: $('#form1').serialize(),
                dataType: 'text',
                success: function (r) {
                    if (r == "OK") {
                        $.Zebra_Dialog('<strong>修改数据成功 ！</strong>');
                    } else {
                        $.Zebra_Dialog('<strong>修改数据失败 ！</strong>');
                    }
                }, error: function (r) {
                    $.Zebra_Dialog('<strong>修改数据失败 ！</strong>');
                }
            });
        }
</script>
</head>
<body>
    <div class="pageHead">
<b>网点类型设置</b>
</div>
    <asp:Repeater ID="Repeater1" runat="server">
    <HeaderTemplate>
        <table  class="tabData" style="width:600px">
          <tr class="tr_head">
                <th style="width:50px; text-align:center;">
                    编号</th>
                <th style="width:100px; text-align:center;">
                    网点类型</th>
                <th style="width:350px; text-align:center;">
                    网点类型说明</th>
                <th style="width:100px; text-align:center;">
                    查看/修改</th>
                
            </tr>
        
    </HeaderTemplate>
    <ItemTemplate>
    <tr style='background-color: <%#(Container.ItemIndex%2==0)?"#FFFFF;":"#fcf3f4"%>' onmouseover="change_colorOver(this)" onmouseout="change_colorOut(this)">
        <td><%#Eval("SerialNumber")%></td>
        <td><%#Eval("strType")%></td>
        <td><%#Eval("strDescript")%></td>
        <td><%#GetUpdateItem(Eval("ID")) %></td>
    </tr>
    </ItemTemplate>
    
    <FooterTemplate><!--底部模板-->
        </table>        <!--表格结束部分-->
        </FooterTemplate>
    </asp:Repeater>
    <form id="form1" runat="server">
    <div  id="divEidt" class="pageEidtInner" style="display:none;">
    <div style="float:right; margin:10px 20px"><input type="button" style="width:60px; background-color:#ccc;" value="关闭" onclick="CloseEidt()" /></div>
    <div>
        <table>
            <tr>
            <td><span>网点类型:</span></td>
            <td><span><input type="text" name="strType" /> </span></td>
            </tr>
            <tr>
            <td><span>工作内容:</span></td>
            <td><span><input type="text" name="strDescript" /> </span></td>
            </tr>
            <tr>
            <td></td>
            <td><input type="button" value="修改网点类型" onclick="WBUpdate()" /> </td>
            </tr>
        </table>
        </div>
    </div>
    </form>
    <%--定义编号--%>
    <input type="hidden" id="WBID" value="" />
    <%--定义背景色的隐藏域--%>
    <input type="hidden" id="colorName" value="" />
</body>
</html>
